#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "MyFile.h"

int main()
{
    // File
    MyFile* fp = Myfopen("log.txt", "w");
    if(NULL == fp)
    {
        perror("fopen fail!\n");
        exit(1);
    }

    // 写入数据
    const char* msg = "Hello MyFile!\n";
    int i = 5;
    while(i--)
    {
        Myfwrite(msg, strlen(msg), 1, fp);
        Myflush(fp);
    }

    Myfclose(fp);
    return 0;
}
